<template>
  <div>
    <div>
      <NavBar :isShowLeft="false">
        <!-- <template slot="left">
          <van-icon name="arrow-left" @click="handleBack" />
        </template> -->
      </NavBar>
    </div>
    <div class="center">
      <div class="pic">
        <img src="../img/success.png" alt="" />
      </div>
      <div class="submit-text">您已成功提交理赔信息!</div>
      <!-- <div class="submit-button" @click="handleClick()">查看订单</div> -->
    </div>
  </div>
</template>
<script>
// import { mapState } from 'vuex'
import NavBar from '@/components/h5header'
// import { isWeChatBrowser } from '@/config/h5/index.js'
import appBackMainPage from '@/services/h5/app-api/appBackMainPage.js'
// import appBackLastPage from '@/services/h5/app-api/appBackLastPage.js'
import { isApp } from '@/utils/platform'
export default {
  data() {
    return {
      data: 'sdsdf',
      swipeFlag:false,
    }
  },
  components: {
    NavBar
  },
  // computed: {
  //   ...mapState('product', ['contractId'])
  // },
  methods: {
    handleClick() {
      // this.$router.push({ path: `/baodan/${this.$route.params.contractId}` })
      this.swipeFlag = true
      this.$router.push({ path: '/myorder'})
    },
    handleBack() {
      let path = localStorage.getItem('successBack')
      if (!isApp || path !== '/product?active=N') {
        this.$router.push(path)
      } else {
        path == '/product?active=N' && appBackMainPage({ pageIndex: '1' })
      }
    }
  },
  beforeDestroy() {
    if(this.swipeFlag) {
      this.handleClick()
    }else {
      this.handleBack()
    }
  }
}
</script>
<style scoped lang="less">
.center {
  width: 375px;
}
.pic {
  width: 93px;
  height: 93px;
  margin: 0 auto;
  margin-top: 147px;
}
.pic img {
  width: 100%;
}
.submit-text {
  width: 375px;
  font-size: 18px;
  color: #333;
  text-align: center;
  margin-top: 15px;
}
.submit-button {
  font-size: 18px;
  width: 117px;
  height: 35px;
  line-height: 35px;
  border-radius: 4px;
  border: 1px solid @c-color-primary;
  color: @c-color-primary;
  text-align: center;
  margin: 0 auto;
  margin-top: 15px;
}
</style>
